package webSocket.demo.controller;

import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.messaging.handler.annotation.SendTo;
import org.springframework.stereotype.Controller;
import webSocket.demo.pojo.Message;

/**
 * @ClassName GreetController
 * @Description TODO
 * @Author milkywayeye
 * @Date 2023/5/5 11:12
 * @Version V1.0
 **/
@Controller
public class GreetController {

    @MessageMapping("/hello")
    @SendTo("/topic/greetings")
    public Message greeting(Message message) {
        return message;
    }
}
